package com.jiermt.M0713;

import java.util.HashMap;
import java.util.function.BiConsumer;

public class Mapdemo1 {
    public static void main(String[] args) {
        HashMap<String, Integer> hashMap = new HashMap<>();
        hashMap.put("hello", 1);
        hashMap.put("world", 2);
        hashMap.put("java", 3);
        // System.out.println(hashMap);

     hashMap.forEach(new BiConsumer<String, Integer>() {
         @Override
         public void accept(String s, Integer integer) {
             System.out.println(s + ":" + integer);
         }
     });
    }
}
